#! /usr/local/bin/node
var config = require("./config");
const fs = require("fs");
const path = require("path");
var exec = require("child_process").exec,
	child;
// process.env.PATH += ":/usr/local/node/bin";
// child = exec("node ./script/twcss.js",function(err,res){
// 	if(err){
// 		console.log('twcss生成失败')
// 	}else{
// 		console.log(res)
//     	runAlltheme()
// 	}
	
// })
runAlltheme()
function runAlltheme(mypath = "./script") {
	const items = fs.readdirSync(mypath);

	let result = [];

	// 遍历当前目录中所有的文件和文件夹

	items.map((item) => {
		let temp = path.join(mypath, item);
        if(item.indexOf("theme") != -1){
            result.push(item);
            child = exec("node "+mypath+"/"+item, function(err, stdout, stderr) {
                if (err) throw err;
                console.log(stdout);
              });
        }
	});

	return result;
}

// console.log(getAllDirs());
